/* util */
import { notificationError, notificationSuccess } from '@src/platform/message'
import { setClipboardData } from '@src/util/dom'

export function useCopy(data: string, successMessage: string, errorMessage: string) {
  setClipboardData(
    data, 
    () => {
      notificationSuccess(successMessage)
    },
    () => {
      notificationError(errorMessage)
    }
  )
}
